.class public Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;
.super Ljava/lang/Object;
.source "GoogleAccountHelper.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper$LoginFragment;
    }
.end annotation


# static fields
.field private static volatile e:Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;


# instance fields
.field private a:Les/v30;

.field private b:Les/g00;

.field private c:Z

.field private d:Lcom/estrongs/android/ui/dialog/r;


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->c:Z

    .line 3
    new-instance v1, Lcom/estrongs/android/pop/f;

    invoke-direct {v1}, Lcom/estrongs/android/pop/f;-><init>()V

    iput-object v1, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a:Les/v30;

    .line 4
    invoke-interface {v1, v0}, Les/v30;->a(Z)V

    return-void
.end method

.method private a()V
    .locals 1

    .line 4
    iget-object v0, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->d:Lcom/estrongs/android/ui/dialog/r;

    if-eqz v0, :cond_0

    .line 5
    invoke-virtual {v0}, Lcom/estrongs/android/ui/dialog/r;->dismiss()V

    const/4 v0, 0x0

    .line 6
    iput-object v0, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->d:Lcom/estrongs/android/ui/dialog/r;

    :cond_0
    return-void
.end method

.method private a(I)V
    .locals 3

    .line 37
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a()V

    .line 38
    invoke-static {}, Lcom/estrongs/android/pop/o;->A0()Lcom/estrongs/android/pop/o;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/estrongs/android/pop/o;->c(Z)V

    .line 39
    iget-object v0, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->b:Les/g00;

    if-nez v0, :cond_0

    return-void

    .line 40
    :cond_0
    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v2

    if-ne v1, v2, :cond_1

    .line 41
    invoke-interface {v0, p1}, Les/g00;->a(I)V

    goto :goto_0

    .line 42
    :cond_1
    new-instance v1, Lcom/estrongs/android/pop/app/premium/account/a;

    invoke-direct {v1, v0, p1}, Lcom/estrongs/android/pop/app/premium/account/a;-><init>(Les/g00;I)V

    invoke-static {v1}, Lcom/estrongs/android/util/o0;->a(Ljava/lang/Runnable;)V

    :goto_0
    return-void
.end method

.method private a(IILandroid/content/Intent;)V
    .locals 1

    const/16 v0, 0x1037

    if-ne p1, v0, :cond_4

    const/4 p1, -0x1

    const/4 v0, 0x0

    if-eq p2, p1, :cond_0

    .line 7
    invoke-direct {p0, v0}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(I)V

    return-void

    .line 8
    :cond_0
    iget-boolean p1, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->c:Z

    if-eqz p1, :cond_2

    if-nez p3, :cond_1

    const-string p1, ""

    goto :goto_0

    :cond_1
    const-string p1, "authCode"

    .line 9
    invoke-virtual {p3, p1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    goto :goto_0

    .line 10
    :cond_2
    iget-object p1, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a:Les/v30;

    invoke-interface {p1, p3}, Les/v30;->a(Landroid/content/Intent;)Ljava/lang/String;

    move-result-object p1

    .line 11
    :goto_0
    invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p2

    if-eqz p2, :cond_3

    .line 12
    invoke-direct {p0, v0}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(I)V

    goto :goto_1

    .line 13
    :cond_3
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(Ljava/lang/String;)V

    :cond_4
    :goto_1
    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;I)V
    .locals 0

    .line 2
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(I)V

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;IILandroid/content/Intent;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1, p2, p3}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(IILandroid/content/Intent;)V

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;Lorg/json/JSONObject;)V
    .locals 0

    .line 3
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(Lorg/json/JSONObject;)V

    return-void
.end method

.method static synthetic a(Les/g00;I)V
    .locals 0

    .line 43
    invoke-interface {p0, p1}, Les/g00;->a(I)V

    return-void
.end method

.method private a(Ljava/lang/String;)V
    .locals 3

    .line 14
    new-instance v0, Lokhttp3/Request$Builder;

    invoke-direct {v0}, Lokhttp3/Request$Builder;-><init>()V

    new-instance v1, Lokhttp3/FormBody$Builder;

    invoke-direct {v1}, Lokhttp3/FormBody$Builder;-><init>()V

    const-string v2, "code"

    .line 15
    invoke-virtual {v1, v2, p1}, Lokhttp3/FormBody$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/FormBody$Builder;

    move-result-object p1

    const-string v1, "pkg"

    const-string v2, "com.estrongs.android.pop"

    .line 16
    invoke-virtual {p1, v1, v2}, Lokhttp3/FormBody$Builder;->add(Ljava/lang/String;Ljava/lang/String;)Lokhttp3/FormBody$Builder;

    move-result-object p1

    .line 17
    invoke-virtual {p1}, Lokhttp3/FormBody$Builder;->build()Lokhttp3/FormBody;

    move-result-object p1

    .line 18
    invoke-virtual {v0, p1}, Lokhttp3/Request$Builder;->post(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;

    move-result-object p1

    const-string v0, "http://api.dkyweipsds.com/user/googleLogin"

    .line 19
    invoke-virtual {p1, v0}, Lokhttp3/Request$Builder;->url(Ljava/lang/String;)Lokhttp3/Request$Builder;

    move-result-object p1

    .line 20
    invoke-virtual {p1}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;

    move-result-object p1

    .line 21
    invoke-static {}, Lcom/estrongs/android/util/j0;->a()Lokhttp3/OkHttpClient;

    move-result-object v0

    .line 22
    invoke-virtual {v0, p1}, Lokhttp3/OkHttpClient;->newCall(Lokhttp3/Request;)Lokhttp3/Call;

    move-result-object p1

    new-instance v0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper$a;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper$a;-><init>(Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;)V

    .line 23
    invoke-interface {p1, v0}, Lokhttp3/Call;->enqueue(Lokhttp3/Callback;)V

    return-void
.end method

.method private a(Lorg/json/JSONObject;)V
    .locals 3

    .line 24
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "jsonObject = "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "googleAccount"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    const-string v0, "ret"

    .line 25
    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v0

    const/16 v1, 0xc8

    if-eq v0, v1, :cond_0

    const/4 p1, 0x3

    .line 26
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(I)V

    return-void

    :cond_0
    const-string v0, "result"

    .line 27
    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object p1

    if-nez p1, :cond_1

    const/4 p1, 0x2

    .line 28
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a(I)V

    return-void

    :cond_1
    const-string v0, "nickname"

    .line 29
    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "avatar"

    .line 30
    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "loginToken"

    .line 31
    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    .line 32
    invoke-static {}, Lcom/estrongs/android/pop/o;->A0()Lcom/estrongs/android/pop/o;

    move-result-object v2

    .line 33
    invoke-virtual {v2, v0}, Lcom/estrongs/android/pop/o;->h(Ljava/lang/String;)V

    .line 34
    invoke-virtual {v2, v1}, Lcom/estrongs/android/pop/o;->g(Ljava/lang/String;)V

    .line 35
    invoke-virtual {v2, p1}, Lcom/estrongs/android/pop/o;->f(Ljava/lang/String;)V

    .line 36
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->c()V

    return-void
.end method

.method public static b()Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;
    .locals 2

    .line 1
    sget-object v0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->e:Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;

    if-nez v0, :cond_1

    .line 2
    const-class v0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;

    monitor-enter v0

    .line 3
    :try_start_0
    sget-object v1, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->e:Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;

    if-nez v1, :cond_0

    .line 4
    new-instance v1, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;

    invoke-direct {v1}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;-><init>()V

    sput-object v1, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->e:Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;

    .line 5
    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    .line 6
    :cond_1
    :goto_0
    sget-object v0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->e:Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;

    return-object v0
.end method

.method private c()V
    .locals 3

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->a()V

    .line 2
    invoke-static {}, Lcom/estrongs/android/pop/o;->A0()Lcom/estrongs/android/pop/o;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/estrongs/android/pop/o;->c(Z)V

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/pop/app/premium/account/GoogleAccountHelper;->b:Les/g00;

    if-nez v0, :cond_0

    return-void

    .line 4
    :cond_0
    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v2

    if-ne v1, v2, :cond_1

    .line 5
    invoke-interface {v0}, Les/g00;->onSuccess()V

    goto :goto_0

    .line 6
    :cond_1
    invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    new-instance v1, Lcom/estrongs/android/pop/app/premium/account/b;

    invoke-direct {v1, v0}, Lcom/estrongs/android/pop/app/premium/account/b;-><init>(Les/g00;)V

    invoke-static {v1}, Lcom/estrongs/android/util/o0;->a(Ljava/lang/Runnable;)V

    :goto_0
    return-void
.end method
